"""
进程、线程概念
进程：就是一个程序，运行在系统之上，便称之为运行进程，分配进程ID方便操作系统管理
线程：归属进程，一个进程可以开启多个线程，执行不同的任务，是进程的实际工作最小单位

import threading

thread_obj = threading.Thread([group,[,target[,name[,args[,kwargs[:]]]]]])
- group: 暂时无用，未来功能的预留参数
- target: 执行目标任务名
- args: 以元组的方式执行任务传参
- kwargs: 以字典方式给执行任务传参
- name: 线程名，一般不用设置

"""
import threading
import time


# def sing():
#     while True:
#         print("我在唱歌，啦啦啦...")
#         time.sleep(1)
#
# def dance():
#     while True:
#         print("我在跳舞，呱呱呱...")
#         time.sleep(1)

# if __name__ == '__main__':
#     thread_sing = threading.Thread(target=sing)
#     thread_dance = threading.Thread(target=dance)
#     thread_sing.start()
#     thread_dance.start()

def sing(msg):
    while True:
        print(msg)
        time.sleep(1)

def dance(msg):
    while True:
        print(msg)
        time.sleep(1)

if __name__ == '__main__':
    thread_sing = threading.Thread(target=sing,args=("我在唱歌，啦啦啦...",))
    thread_dance = threading.Thread(target=dance,kwargs={"msg":"我在跳舞，呱呱呱..."})
    thread_sing.start()
    thread_dance.start()